<?php

use Doraemon\tools\HhzEnv;

ini_set('display_errors', 1);
error_reporting(-1);
require_once '/data/wwwroot/g_vendor/autoload.php';

$uid = $argv[1] ?? 0;
$cache = $argv[2] ?? '';
$key = \Doraemon\pockets\constInterface\CacheKey::CACHE_KEY_PREFIX_POSITION_USER_PROFILE . $uid;

if ($cache) {
    if (!(HhzEnv::isShopTest() || HhzEnv::isTest())) exit('仅限开发测试环境操作');
    $arr = json_decode($cache, true);
    \Biz\cache\advertisement\CNewUserProfile::hMSet($key, $arr);
} else {
    $rs = \Biz\cache\advertisement\CNewUserProfile::hGetAll($key);
    exit(json_encode($rs));
}
